package com.example.gyj.dao;

import com.example.gyj.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * Created by Gao on 2018/10/21.
 */
@Mapper //加上@Mapper注解，否则扫描不到dao
public interface UserDao {

    @Select("select * from s_user where id = #{id}")
    public User getUserById(@Param("id") long id);

    @Select("update s_user set password = #{password} where id = #{id}")
    public User update(User toBeUpdate);
}
